/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.edu.senaclem.persistencia;

import co.edu.senaclem.modelo.Clienteexterno;
import co.edu.senaclem.modelo.Personal;
import java.sql.ResultSet;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author anfeles
 */
@Stateless
public class ClienteExternoDAO implements IClienteExternoDAO{
    @PersistenceContext
    private EntityManager entityManager;
    
    @Override
    public Clienteexterno consultarPorId(Long documento) throws Exception {
        try {
            return entityManager.find(Clienteexterno.class, documento);
        } catch (RuntimeException e) {
            throw e;
        }
    }

    @Override
    public void insertar(Clienteexterno clienteExterno) throws Exception {
        try {
            entityManager.persist(clienteExterno);
        } catch (RuntimeException e) {
            throw e;
        }
    }
    
}
